package cn.kdlc.demo.recycler.model;

import android.databinding.BaseObservable;
import android.databinding.Bindable;

import java.io.Serializable;

/**
 * Created by android on 2015/11/26 0026.
 */
public class User extends BaseObservable implements Serializable {

    private boolean isHeader;

    private int id;

    private String name;

    private int age;

    public User(int id, String name, int age) {
        this.isHeader = false;
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public User(boolean isHeader, int id, String name, int age) {
        this.isHeader = isHeader;
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public boolean isHeader() {
        return isHeader;
    }

    public void setIsHeader(boolean isHeader) {
        this.isHeader = isHeader;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Bindable
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(cn.kdlc.demo.recycler.BR.name);
    }

    @Bindable
    public String getAge() {
        return age + "岁";
    }

    public void setAge(int age) {
        this.age = age;
        notifyPropertyChanged(cn.kdlc.demo.recycler.BR.age);
    }
}
